home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_volcutscene.cog < prev    next >
Text File  |  1999-11-15  |  15KB  |  593 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_VolCutScene.cog
  4. #
  5. # [TL]    [GGJ]  [HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ==============================================================================
  10.  
  11. symbols
  12.  
  13.     message        startup
  14.     message        entered
  15.     message        activated
  16.     message        callback
  17.     message        user0
  18.     message        user1
  19.  
  20. # ................................ ANIMATIONS ..................................
  21.  
  22.     keyframe    volDrop=0vo_geardrop_3.key            local # mk @ x90/cb16
  23.     keyframe    voluse=0vo_handoutR_2_3.key            local # mk @ x10/cb16
  24.     keyframe    indyGesture=0in_armsout_1_1.key        local
  25. ####    keyframe    in_gunOut=in_walk_w_gun.key            local # in_attack_pull_gun.key
  26.     keyframe    in_gunOut=in_attack_pull_gun.key    local # TEST!
  27.     keyframe    in_gunaway=in_attack_put_gun.key    local # 32x
  28.     keyframe    in_actlow=in_reach_low.key            local # 56x (act=83x)
  29.     keyframe    kneel=0in_stand1_bd_6.key               local # 32x
  30.     keyframe    standUp=0in_stand6_bd_1.key            local # 53x
  31.  
  32. # ................................. MODELS .....................................
  33.     
  34.     model        mod_vo_gearhand=hand_vo_turtgear.3do    local
  35.     model        mod_in_revolver=weap_revolver.3do    local
  36.     model        mod_in_tokarev=weap_tokarev.3do        local
  37.     model        mod_in_mauser=weap_mauser.3do        local
  38.  
  39. # ................................. SOUNDS .....................................
  40.  
  41.     sound        in_badidea0=Inxj058.wav                local # won't work
  42.     sound        in_badidea1=Inxj060.wav                local # not right answer
  43.     sound        in_badidea2=Inxj061.wav                local # not good idea
  44.     sound        in_badidea3=Inxj260.wav                local # could be useful elsewhere
  45.     
  46.     sound        voice0=NB04V01.WAV                    local
  47.     sound        voice1=inxj268.WAV                    local # inxj233.wav                    local
  48.     sound        voice2=INXJ136.WAV                    local
  49.     sound        voice3=INXJ132.WAV                    local
  50.     sound        surrenderSnd=nb05V04.wav            local # Don't shoot!  It's only a bronze gear.  You can have it!
  51.     sound        gotYou=nb05j01.wav                    local # Volodnikov!  Now I've got you!
  52.     sound        dropSnd=nub_gear_drop.wav            local        
  53.     sound        click=nub_anubisarm_place_c.wav        local
  54.     sound        gearSnd=INXJ147.wav                    local # Aha...  (Was INXJ196.wav- A bronze gear...)
  55.     sound        put=gen_pistol_put.wav                local
  56.     sound        pull=gen_pistol_pull.wav            local
  57.  
  58. # .................................. THINGS ....................................
  59.  
  60.     thing        player                                local
  61.  
  62.     thing        cam0                                nolink
  63.     thing        cam1                                nolink
  64.     thing        cam2                                nolink
  65.     thing        cam3                                nolink
  66.     thing        cam4                                nolink
  67.     thing        cam5                                nolink
  68.     thing        centerCam                            nolink
  69.     thing        varcam                                local # var
  70.  
  71.     thing        mazeTarg                            nolink
  72.     thing        cam0Targ                            nolink
  73.     thing        cam1Targ                            nolink
  74.     thing        cam3Targ                            nolink
  75.     thing        centerHiTarg                        nolink
  76.     thing        centerMedTarg                        nolink
  77.     thing        centerLoTarg                        nolink
  78.  
  79.     thing        indy
  80.     thing        indy2
  81.     thing        indy3
  82.     thing        vol
  83.     thing        vol2
  84.     thing        vol3
  85.     thing        indyactor                            local # var
  86.             
  87.     thing        gear
  88.     thing        post
  89.     thing        postInvisibox
  90.  
  91.     thing        gearItem                            # dropped by Vol
  92.  
  93.     thing        indyGhostNorth                        nolink
  94.     thing        indyGhostSouth                        nolink
  95.     thing        grab_mk_N                            nolink
  96.     thing        grab_mk_S                            nolink
  97.     thing        indymark                            local # var
  98.     thing        grabmark                            local # var
  99.     thing        volmark                                local # var
  100.  
  101.     thing        waypoint19
  102.     thing        waypoint20
  103.  
  104.     thing        ladder1
  105.     thing        generator_pos0
  106.     thing        enemy0                                local
  107.  
  108. # ........................... WORLD REFERENCES .................................
  109.  
  110.     surface        ladderface_1
  111.     surface        ladderface_2
  112.  
  113.     sector        startsector
  114.  
  115. # ........................... ENGINE REFERENCES ................................
  116.  
  117.     cog         catchvol
  118.     cog            hint
  119.  
  120.     template    enemy0_tpl
  121.     template    actortpl=indy_sh_actor                local
  122.  
  123. # ............................... VARIABLES ....................................
  124.  
  125.     vector        v_targetpos                            local
  126.  
  127.     flex        getgear                                local # label
  128.  
  129.     int            tempActor                            local
  130.  
  131.     int            done0=0                                local
  132.     int            swapevent=0                            local
  133.     int            in_swapItem1                        local
  134.     int            vo_swapItem1                        local
  135.     int            vo_swapItem2                        local
  136.     int            in_keyTrack1                        local
  137.     int            vo_keyTrack1                        local
  138.     int            cursound                            local
  139.     int            whichway                            local
  140.     int            newline=50                            local
  141.     int            oldline=50                            local
  142.     int            firstline=0                            local
  143.         
  144.     cog                     NUB_Commie_Grid         #added by JM
  145.  
  146.     AI          AI_Sniper=com_2Hsniper.ai   local
  147.  
  148. end
  149.  
  150. # ==============================================================================
  151.  
  152. code
  153.  
  154. startup:
  155.     SetCollideType(post, 3);
  156.     
  157.     player = GetLocalPlayerThing();
  158.  
  159.     ClearSurfaceFlags(ladderface_1, 0x2000);
  160.     ClearSurfaceFlags(ladderface_2, 0x2000);
  161.     SetCollideType(ladder1, 0);
  162.     SetThingFlags(ladder1, 0x80000);
  163.  
  164.     #make hangable.
  165.     SetSurfaceFlags(ladderface_1, 0x1000000);
  166.     
  167.     SetThingFlags(indy, 0x80000);
  168.     SetThingFlags(vol, 0x80000);
  169.  
  170.     SetThingLight(gear, '0.5 0.5 0.5', 0.1, 1.0);
  171.     SetThingLight(post, '0.5 0.5 0.5', 0.1, 1.0);
  172.     SetThingFlags(gearItem, 0x80000);
  173.  
  174. return;
  175.  
  176. # ..............................................................................
  177.  
  178. entered:
  179.  
  180. if (GetSourceRef() == player)
  181. {
  182.     if (done0 == 1) return;
  183.  
  184.     if (GetSenderRef() == startsector)
  185.     {
  186.         done0 = 1;
  187.         
  188.         SetActorFlags(player, 0x200000);
  189.         StartCutscene(1);
  190.  
  191.         if ((GetMoveStatus(player) == 1) || (GetMoveStatus(player) == 2))
  192.         {
  193.             StopThing(player);
  194.         }
  195.  
  196.         # Prep...
  197.         MakeMeStop();
  198.         DeselectWeaponWait(player);
  199.         CopyPlayerHolsters(player, indy);
  200.         ClearThingFlags(vol, 0x80000);
  201.  
  202.         # Indy looks cam rt...
  203.         tempActor = CreateThing(actorTpl, player);
  204.         CaptureThing(tempActor);
  205.         CopyPlayerHolsters(player, tempActor);
  206.         ClearThingFlags(tempActor, 0x80000);
  207.         SetThingFlags(player, 0x80000);
  208.         SetThingMaxRotVel(tempActor, 100.0);
  209.         AISetLookThing(tempActor, cam3);
  210.         Sleep(0.5);
  211.         DestroyThing(tempActor);
  212.  
  213.         # Cut to shot of Indy from stair top ...
  214.         SetCameraLookInterp(2, 0);
  215.         SetCameraPosInterp(2, 0);
  216.         SetCameraFocus(2, cam0);
  217.         SetCameraSecondaryFocus(2, cam0Targ);
  218.         SetCurrentCamera(2);
  219.         SetCameraFOV(65, 0, 0.0); # was 60
  220.         
  221.         # Walk Indy to cam...
  222.         ClearThingFlags(indy, 0x80000);
  223.         AttachThingToThing(cam0Targ, indy);
  224.         AISetMoveSpeed(indy, 1.0);
  225.         AISetLookThingEyeLevel(indy, mazeTarg);
  226.         AISetMoveThing(indy, mazeTarg, 0);
  227.         Sleep(0.01);
  228.         SetCameraFOV(55, 1, 3.0);
  229.         AIWaitForStop(indy);
  230.  
  231.         # Indy: "Hmmm"
  232.         AISetLookThing(indy, vol);
  233.         PlayVoice(indy, voice1, 1.0, 0);
  234.         Sleep(0.2);
  235.  
  236.         # Dolly to V...
  237.          SetCameraInterpSpeed(2, 2.0);
  238.         SetCameraLookInterp(2, 1);
  239.         SetCameraPosInterp(2, 1);
  240.         Sleep(0.01);
  241.         SetCameraFocus(2, cam3);
  242.         SetCameraSecondaryFocus(2, cam1Targ);
  243.         SetCameraFOV(25, 1, 2.0);
  244.         Sleep(2.5);
  245.  
  246.         # Cut to CU of Vol...
  247.         SetCameraLookInterp(2, 0);
  248.         SetCameraPosInterp(2, 0);
  249.         SetCameraFocus(2, cam1);
  250.         SetCameraSecondaryFocus(2, cam3Targ);
  251.         SetCameraFOV(45, 0, 0.0);
  252.         Sleep(0.1);
  253.                 
  254.         # Indy: "Dr. Volodnikov!"
  255.         cursound = PlayVoice(indy, voice3, 1.0, 0);
  256.         PlayKey(indy, indyGesture, 4, 0x12, 0);
  257.         Sleep(0.3);
  258.  
  259.         # V turns...
  260.         SetThingMaxRotVel(vol, 180.0);
  261.         AISetLookThing(vol, indy);
  262.         WaitForSound(cursound);
  263.         AIWaitForStop(vol);
  264.         Sleep(0.1);
  265.         AISetLookThingEyeLevel(vol, gear);
  266.         Sleep(0.3);
  267.  
  268.         # Vol: "Bozhemoi!"
  269.         PlayVoice(vol, voice0, 0.5, 0);
  270.         
  271.         # Vol takes gear (see callback)...
  272.         AIWaitForStop(vol);
  273.         swapevent = 1;
  274.         PlayKey(vol, voluse, 1, 0x2, 0); 
  275.         Sleep(0.5);
  276.  
  277.         # Run Vol away...
  278.         AISetLookFrame(vol, 1);
  279.         Sleep(0.5);
  280.         AISetMoveSpeed(vol, 1.7);
  281.         AISetMoveFrame(vol, 1);
  282.         Sleep(1.0);
  283.  
  284.         # New Vol...
  285.         ClearThingFlags(vol3, 0x80000);
  286.         SetThingFlags(vol3, 0x10);
  287.         vo_swapItem1 = SetThingMesh(vol3, 8, mod_vo_gearhand, 0);
  288.         AISetLookFrame(vol3, 1);
  289.         AISetMoveSpeed(vol3, 2.0);
  290.         Sleep(0.2);
  291.         AISetMoveFrame(vol3, 1);
  292.         
  293.         # Back to top of stairs...
  294.         DestroyThing(vol);
  295.         ClearThingFlags(vol3, 0x10);
  296.         AIEnableBodyTracking(indy, vol3);
  297.         SetCameraFocus(2, cam3);
  298.         SetCameraSecondaryFocus(2, vol3);
  299.         SetCameraFOV(45, 0, 0.0);
  300.         SetCameraPosInterp(2, 1);
  301.         SetCameraInterpSpeed(2, 1.5);
  302.         Sleep(0.01);
  303.         
  304.         # Dolly back...
  305.         SetCameraFocus(2, cam5);
  306.         SetCameraFOV(90, 1, 1.5);
  307.         Sleep(1.5);
  308.         DestroyThing(vol3); 
  309.         Sleep(0.5);
  310.  
  311.         # Indy: "wonder what V up to now..."
  312.         PlayVoice(indy, voice2, 1.0, 0);
  313.         TeleportThing(player, indy);
  314.         Sleep(2.0);
  315.          DetachThing(Cam0Targ);
  316.         DestroyThing(indy);
  317.         ClearThingFlags(player, 0x80000);
  318.                
  319.         # Clean up...
  320.         SetCameraLookInterp(2, 0);
  321.         SetCameraPosInterp(2, 0);
  322.         SetCameraPosition(1, GetThingPos(cam5));
  323.         SetCurrentCamera(1);
  324.  
  325.         ClearActorFlags(player, 0x200000);
  326.         EndCutScene();
  327.     }
  328. }
  329.  
  330. return;
  331.  
  332. # ..............................................................................
  333.  
  334. activated:
  335.  
  336.     if ((GetSenderRef() == postInvisibox) && (GetCurItem(player) == 67))
  337.     {
  338.         
  339.         While (newline == oldline)
  340.         {
  341.             newline = Randbetween(0, 3);
  342.             if (firstline == 0 && newline == 3)
  343.             {
  344.                 newline == oldline;
  345.             }
  346.         }
  347.         firstline = 1;
  348.         oldline = newline;
  349.         Sleep(0.5);
  350.         PlayVoice(player, in_badidea0[newline], 1, 1);
  351.         Sleep(0.2);
  352.     }            
  353.  
  354.     return;
  355.  
  356. # ..............................................................................
  357.  
  358. user0:
  359.  
  360.     # Received when South entrance is blocked...
  361.  
  362.     whichway = 0;
  363.     indyactor = indy3;
  364.     varcam = cam4;
  365.     indymark = indyGhostNorth;
  366.     grabmark = grab_mk_N;
  367.     volmark = waypoint20;
  368.     goto getgear;
  369.  
  370.     return;
  371.  
  372. # ..............................................................................
  373.  
  374. user1:
  375.  
  376.     whichway = 1;
  377.     indyactor = indy2;
  378.     varcam = cam2;
  379.     indymark = indyGhostSouth;
  380.     grabmark = grab_mk_S;
  381.     volmark = waypoint19;
  382.     goto getgear;
  383.  
  384.     return;
  385.  
  386. # ..............................................................................
  387.  
  388. getgear:
  389.  
  390.     # Hide player and reveal actor...
  391.     StartCutscene(1);
  392.     SetActorFlags(player, 0x200000);
  393.  
  394.     if ((GetMoveStatus(player) == 1) || (GetMoveStatus(player) == 2))
  395.     {
  396.         StopThing(player);
  397.     }
  398.  
  399.  
  400.  
  401.     MakeMeStop();
  402.     DeselectWeaponWait(player);
  403.     CopyPlayerHolsters(player, indyactor);
  404.     AISetCutsceneMode(indyactor);
  405.     SetThingFlags(player, 0x80000);
  406.     ClearThingFlags(indyactor, 0x80000);
  407.     AISetCutsceneMode(vol2);
  408.     SetCollideType(vol2, 0);
  409.     ClearThingFlags(vol2, 0x80000);
  410.     vo_swapItem2 = SetThingMesh(vol2, 8, mod_vo_gearhand, 0);
  411.     AISetLookThingEyeLevel(indyactor, indymark);
  412.  
  413.     # TO DO: Randy!  Indy should pull current 1h weap...
  414.  
  415.     swapevent = 3;
  416.     in_keyTrack1 = PlayKey(indyactor, in_gunout, 0, 0x14, 0); # see callback
  417.  
  418.     # Cut to V & Indy...
  419.     SetCameraLookInterp(2, 0);
  420.     SetCameraPosInterp(2, 0);
  421.     SetCameraFocus(2, varcam);
  422.     SetCameraSecondaryFocus(2, indyactor);    
  423.     SetCurrentCamera(2);
  424.     SetCameraFOV(38 , 0, 0.0);
  425.  
  426.     # Indy walks in...
  427.     AISetMoveSpeed(indyactor, 1.1);
  428.     AISetMoveThing(indyactor, indymark, 0);
  429.     SetCameraLookInterp(2, 1);
  430.     SetCameraInterpSpeed(2, 1.5);
  431.     Sleep(0.01);
  432.  
  433.     # Pan to include V...
  434.     SetCameraSecondaryFocus(2, centerHiTarg);
  435.     SetCameraFOV(85, 1, 1.5);
  436.  
  437.     Sleep(0.5);
  438.     AIEnableHeadTracking(indyactor, vol2);
  439.     AIEnableHeadTracking(vol2, indyactor);
  440.     AIWaitForStop(indyactor);
  441.  
  442.     # Indy faces V...
  443.     AIDisableHeadTracking(vol2);
  444.     AIDisableHeadTracking(indyactor);
  445.     AISetLookThing(vol2, indyactor);
  446.     AISetLookThing(indyactor, vol2);
  447.      
  448.     # Indy: "now got you..."
  449.     PlayVoice(indyactor, gotYou, 1.0, 1);
  450.  
  451.     # Cut to V...
  452.     SetCameraLookInterp(2, 0);
  453.     SetCameraFocus(2, centerCam);
  454.     SetCameraSecondaryFocus(2, centerHiTarg);
  455.     SetCameraFOV(28, 0, 0.0);
  456.  
  457.     # Vol: "you can have...gear"
  458.     PlayVoice(vol2, surrenderSnd, 1.0, 0);
  459.     Sleep(0.2);
  460.  
  461.     # V drops gear (see callback)...
  462.     swapevent = 2;
  463.     vo_keyTrack1 = PlayKey(vol2, volDrop, 4, 0x12, 0);
  464.     Sleep(3.6); # was 3.5
  465.  
  466.     # Pan down to gear...
  467.     SetCameraLookInterp(2, 1);
  468.     SetCameraInterpSpeed(2, 0.5);
  469.     Sleep(0.01);
  470.     SetCameraSecondaryFocus(2, centerLoTarg);
  471.     Sleep(0.3);
  472.     
  473.     AISetLookThingEyeLevel(vol2, volmark);
  474.     AISetMoveSpeed(vol2, 2.5);
  475.     AISetMoveThing(vol2, volmark, 0);
  476.     Sleep(1.0);
  477.     DestroyThing(vol2);
  478.  
  479.     # Instantly putaway gun (Randy, fix holster to show current 1h weap) ...
  480.     AISetLookThing(indyactor, gearItem);
  481.     swapevent = 4;
  482.     StopKey(indyactor, in_keyTrack1, 0.0);
  483.     PlayKey(indyactor, in_gunaway, 4, 0x12, 1);
  484.     #RestoreThingMesh(indyactor, in_swapItem1);
  485.  
  486.     # Indy picks up gear...
  487.     AISetMoveThing(indyactor, grabmark, 1);
  488.     PlayKey(indyactor, in_actlow, 4, 0x12, 0);
  489.  
  490.     # Widen out to frame him...
  491.     SetCameraInterpSpeed(2, 2.0);
  492.     Sleep(0.01);
  493.     SetCameraSecondaryFocus(2, centerMedTarg);
  494.     SetCameraFOV(55, 1, 2.0);
  495.     Sleep(0.5);
  496.  
  497.     # Indy: "Aha..."
  498.     PlayVoice(indyactor, gearSnd, 1.0, 0);
  499.     Sleep(0.5);
  500.  
  501.     DestroyThing(gearitem);
  502.     ChangeInv(player, 67, 1.0);
  503.     SetInvAvailable(player, 67, 1);
  504.     JonesInvItemChanged(67);
  505.  
  506.     TeleportThing(player, indyactor);
  507.     Sleep(2.0);
  508.  
  509.     # Make campos...
  510.     if (whichway == 0)
  511.     {
  512.         v_targetpos = VectorAdd(VectorTransformToOrient(player, '0.25 -0.1 0.0'), GetThingPos(player));    
  513.     }
  514.     else
  515.     {
  516.         v_targetpos = VectorAdd(VectorTransformToOrient(player, '-0.25 -0.1 0.0'), GetThingPos(player));    
  517.     }
  518.     SetCameraPosition(1, v_targetpos);
  519.  
  520.     SetCurrentCamera(1);
  521.     ResetCameraFOV(0, 0.0);
  522.  
  523.     DestroyThing(indy2);
  524.     DEstroyThing(indy3);
  525.  
  526.     ClearThingFlags(player, 0x80000);
  527.     ClearActorFlags(player, 0x200000);
  528.     EndCutScene();
  529.  
  530.     #make un-hangable...
  531.     ClearSurfaceFlags(ladderface_1, 0x1000000);
  532.  
  533.     SetSurfaceFlags(ladderface_1, 0x2000);
  534.     SetSurfaceFlags(ladderface_2, 0x2000);
  535.     ClearThingFlags(ladder1, 0x80000);
  536.     enemy0 = CreateThing(enemy0_tpl, generator_pos0);
  537.     CaptureThing(enemy0);
  538.  
  539.     AISetClass(enemy0, AI_sniper);
  540.  
  541.     ClearThingFlags(enemy0, 0x80000);
  542.     
  543.     SendMessage(NUB_Commie_Grid, User5);        //added by JM       
  544.     SendMessage(hint, User4);
  545.     
  546.     SetCameraLookInterp(2, 0);
  547.     SetCameraPosInterp(2, 0);
  548.  
  549. return;
  550.  
  551. # ..............................................................................
  552.  
  553. callback:
  554.  
  555.     if (swapevent == 1)
  556.     {
  557.         vo_swapItem1 = SetThingMesh(vol, 8, mod_vo_gearhand, 0);
  558.         PlaySoundThing(click, gear, 1.0, -1, -1, 0);
  559.         DestroyThing(gear);
  560.         swapevent = 0; # reset
  561.     }
  562.  
  563.     if (swapevent == 2)
  564.     {
  565.         RestoreThingMesh(vol2, vo_swapItem2);
  566.         PlaySoundThing(dropSnd, gearItem, 1, -1, -1, 0x80);
  567.         ClearThingFlags(gearItem, 0x80000);
  568.         swapevent = 0;
  569.     }
  570.  
  571.     if (swapevent == 3)
  572.     {
  573.         ResetHolsterModel(indyactor, 2);
  574.         PlaySoundThing(pull, indyactor, 1, -1, -1, 0x80);
  575.         SetWeaponModel(indyactor, GetLastPistol(player));
  576.         Print("pull gun");
  577.         #in_swapItem1 = SetThingMesh(indyactor, 15, mod_in_revolver, 0);
  578.         swapevent = 0; # reset
  579.     }
  580.     if (swapevent == 4)
  581.     {
  582.         # Indy holsters revolver...
  583.         SetHolsterModel(indyactor, GetLastPistol(player), 17);
  584.         PlaySoundThing(put, indyactor, 1, -1, -1, 0x80);
  585.         ResetWeaponModel(indyactor);
  586.         swapevent = 0;
  587.     }
  588.  
  589.     return;
  590.  
  591. end
  592.  
  593.